#include "widget.h"
#include "ui_widget.h"
#include <QDial>
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->dial->setWrapping(true);
    ui->dial->setNotchesVisible(true);
    ui->dial->setSliderPosition(true);
    ui->dial->setMaximum(100);
    ui->dial->setMinimum(1);
    ui->dial->setValue(100);

}

void Widget::on_dial_valueChanged(int value)
{
    qDebug() << value;
    ui->label->setText("当前透明度" + QString::number((double)value / 100));
    this->setWindowOpacity((double)value / 100);
}

Widget::~Widget()
{
    delete ui;
}
